package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class redirecionaServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public redirecionaServlet() {
		super();
	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
		response.setCharacterEncoding("UTF-8");
		request.setCharacterEncoding("UTF-8");

		Integer funcao = (Integer)request.getSession().getAttribute("idfuncao");
		
		if(funcao == 2){
			response.sendRedirect("designer.jsp");
		}
		if(funcao == 3){
			response.sendRedirect("impressor.jsp");
		}
		if(funcao == 4){
			response.sendRedirect("producao.jsp");
		}
		if(funcao == 5){
			response.sendRedirect("entregador.jsp");
		}
		
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}

}
